<script setup lang="ts">
withDefaults(
    defineProps<{
        type?: 'error' | 'primary' | 'warning';
        tipText: string;
    }>(),
    {
        type: 'primary'
    }
);
</script>

<template>
    <el-tooltip :show-after="300" placement="top" effect="dark" :content="tipText">
        <span class="mark" :class="type">
            <slot />
        </span>
    </el-tooltip>
</template>

<style scoped lang="scss">
@include b(mark) {
    box-sizing: border-box;
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 2px;
}

.mark + .mark {
    margin-left: 8px;
}

@include b(primary) {
    color: var(--q-color-primary);
    background: #00bb2c33;
    border-color: var(--q-color-primary);
}

@include b(error) {
    color: var(--q-color-danger);
    background: #fc484833;
    border-color: var(--q-color-danger);
}

@include b(warning) {
    color: var(--q-color-warning);
    background: #ff871333;
    border-color: var(--q-color-warning);
}
</style>
